import request from "@/utils/request";
import { file } from "@/api/file/index";
export const apis = {
  add: (data) => {
    return request({
      url: "key/personnel/admin/add",
      method: "post",
      data: data,
    }).then((res) => {
      return res;
    });
  },
  query: (params) => {
    return request({
      url: "key/personnel/admin/list",
      method: "get",
      params,
    });
  },
  del: (row) => {
    return request({
      url: "key/personnel/admin/delete",
      method: "delete",
      data: {
        id: row.id,
      },
    }).then((res) => {
      if (row.fileId) {
        file.del(row.fileId);
      }
      return res;
    });
  },
  update: (data) => {
    return request({
      url: "key/personnel/admin/edit",
      method: "put",
      data: data,
    });
  },
  count: (data) => {
    return request({
      url: "/key/personnel/admin/count",
      method: "post",
      data: data,
    });
  },
};

export const rylx = {
  add: (data) => {
    return request({
      url: "/keyPersonnelAdminType/add",
      method: "post",
      data: data,
    }).then((res) => {
      return res;
    });
  },
  query: (params) => {
    return request({
      url: "/keyPersonnelAdminType/list",
      method: "get",
      params,
    });
  },
  del: (row) => {
    return request({
      url: "/keyPersonnelAdminType/delete",
      method: "delete",
      data: {
        id: row.id,
      },
    });
  },
  update: (data) => {
    return request({
      url: "/keyPersonnelAdminType/edit",
      method: "put",
      data: data,
    });
  },
};
